package com.huike.web.controller.report;


import com.huike.report.domain.vo.IndexTodayInfoVO;
import com.huike.report.domain.vo.IndexTodoInfoVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.huike.common.core.domain.AjaxResult;
import com.huike.report.service.IReportService;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.concurrent.CompletableFuture;

@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private IReportService reportService;


    /**
     * 首页--基础数据统计
     *
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    @GetMapping("/getBaseInfo")
    public AjaxResult getBaseInfo(@RequestParam("beginCreateTime") String beginCreateTime,
                                  @RequestParam("endCreateTime") String endCreateTime) {


        return AjaxResult.success(reportService.getBaseInfo(beginCreateTime, endCreateTime));
    }

    @GetMapping("/getTodayInfo")
    public AjaxResult getToday() {
        IndexTodayInfoVO TodayInfo = reportService.getTodayInfo();
        return AjaxResult.success(TodayInfo);
    }


    @GetMapping("/getTodoInfo")
    public AjaxResult getBackLog(@Param("beginCreateTime") String beginCreateTime,
                                 @Param("endCreateTime") String endCreateTime) {
        IndexTodoInfoVO backInfo = reportService.getBackInfo(beginCreateTime, endCreateTime);
        return AjaxResult.success(backInfo);
    }


    @GetMapping("/businessChangeStatistics")
    public AjaxResult getBusinessChange(String beginCreateTime,String endCreateTime,Long deptId){
        return AjaxResult.success(null);
    }

}